<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateCategoryPivotCustomerTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('category_pivot_customer', function(Blueprint $table)
		{
			$table->integer('id', true);
			$table->integer('customer_id')->comment('关联customers表的id');
			$table->integer('category_id')->comment('关联category表的id');
			$table->integer('priority')->default(0)->comment('排序的规则，越大越靠前');
			$table->integer('is_show')->default(1)->comment('是否显示  0：隐藏，1：显示');
			$table->timestamps();
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('category_pivot_customer');
	}

}
